feat: marketplace tab + 一键发布 + Settings 风格市场配置#444
Merged
Conversation
added 2 commits
May 15, 2026 14:02
围绕 user goal 1 (a-e) 实现: - (a) 后端验证:5 个 marketplace_* IPC,HTTP 通过 reqwest 调 backend - (b) 上传与拉取无问题:marketplace_install / marketplace_upload 复用本地 ZIP IPC - (c) 单独弹窗:详情 + 上传选包器走 Modal 半透明背景中央卡片 - (d) 搜索框:顶部 input 300ms 防抖 + server-side ?q= 过滤 - (e) 按排名推荐:默认 sort=popular(按 like_count DESC) 后端 IPC(commands.rs): - marketplace_list / detail / install / upload / like - HTTP base URL 走 prefs.marketplace_base_url(默认 http://127.0.0.1:8090) - dev-mode auth 走 prefs.marketplace_dev_login → X-Dev-User header - install 路径:下载 ZIP 到 temp → 调既有 import_from_zip → 删 temp - upload 路径:export 本地 pack → multipart POST → 后端入审核队列 UserPreferences 加两个字段(5 处 wiring:struct/Wire/Default×2/Deserialize): - marketplace_base_url (空 = localhost:8090 默认) - marketplace_dev_login (空 = 上传按钮 disabled) 前端: - types.ts 加 MarketplaceListItem / MarketplaceDetail - ipc.ts 加 5 个 wrapper + mock fixture(vite dev 模式仍可演示 UI) - pages/Marketplace.tsx (~350 行) UI:搜索 / 排序 toggle / 卡片 grid / 详情弹窗 / 上传选包器 - FloatingShell.tsx + state/useAppState.ts 加 marketplace AppTab - 5 语言 i18n 补全 nav.marketplace + marketplace.* 子树(en/zh-CN/zh-TW 完整,ja/ko nav 本地化 + 子树 fallback en) cargo test 263 全过;tsc 0 error。
…oal 2.e) Goal 2.e 一键发版到云端: - Style.tsx 详情页加「发布到风格市场」按钮(在导出 ZIP 旁), 调既有 marketplace_upload IPC。disabled 直到用户在 Settings 配 GitHub login。 - Settings.tsx 加「风格市场」折叠区:marketplaceBaseUrl + marketplaceDevLogin 两个 input。base URL 空 = localhost:8090 dev 默认;生产填 https://api.<domain>。 - 5 语言 i18n(zh-CN/en/ja/ko/zh-TW)补全 marketplace 相关 settings 文案 cargo test 263 全过;tsc 0 error。
PR Reviewer Guide 🔍(Review updated until commit 9e119e2)Here are some key observations to aid the review process:
|
… (pr_agent #444 round 2) pr_agent 提的两个真问题: 1. Security: arbitrary file write —— marketplace_install 用 backend-controlled pack_id 拼临时文件路径。若 backend 被攻陷返回路径遍历 id,可写客户端任意位置。 修:4 个 marketplace_* IPC 全部加 is_valid_session_id() UUID-v4 白名单 校验(跟 read_audio_recording 同套 boundary 校验)。 2. Race condition: 搜索 refresh 旧请求晚到覆盖新结果。用户连续输入时体验差。 修:useRef 单调递增 seq token,response 到了 check seq 是否最新,stale 直接丢。 cargo test 263 全过;tsc 0 error。
|
Persistent review updated to latest commit 4af7fec |
跟 round 2 同类 race condition:openDetail 用户快速点两张卡片时,先点 A 的 detail response 可能晚于 B 到达 → 覆盖 B 的 detail / Install / Like 作用错对象。 修:复用 useRef seq token 模式,detailSeqRef 单调递增,response 比较 seq 丢 弃 stale。逻辑跟 refresh() 完全对称。
|
Persistent review updated to latest commit 9e119e2 |
Collaborator
Author
|
pr_agent round 3 提的 Like gating 是真 UX 一致性问题但 LOW:
本 PR round 1-3 处理的真问题:
Goal 4 验收继续 merge。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Summary
新增 Style Pack Marketplace 客户端集成(对接 openless-marketplace 私有后端):
pages/Marketplace.tsx:搜索 + 排序(热度/最新)+ 卡片列表 + 详情 Modal + 上传选包器commands.rs):list / detail / install / upload / like —— 通过 HTTP 调 marketplace backendmarketplaceBaseUrl/marketplaceDevLogin(dev 模式 auth)marketplace_uploadIPCTest plan
不发 tag
合并到 beta,等下一个 Beta 一起发版。
PR Type
Enhancement
Description
Add Marketplace browsing and detail modal
Wire Rust IPC to marketplace backend
Persist marketplace URL and dev login
Add publish button and translations
Diagram Walkthrough
File Walkthrough
14 files
Add marketplace HTTP command handlersRegister new marketplace commandsAdd Marketplace tab to navigationAdd English marketplace copyAdd Japanese marketplace localization stringsAdd Korean marketplace localization stringsAdd Simplified Chinese marketplace copyAdd Traditional Chinese marketplace copyAdd marketplace IPC wrappers and mocksAdd marketplace TypeScript interfacesImplement marketplace browse and actionsAdd marketplace settings sectionAdd publish to marketplace actionExtend app state with marketplace tab1 files
Persist marketplace preferences in user settings1 files
Update preference fixtures for marketplace